package com.lahuan;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.sql.DataSource;
import java.util.Arrays;

/**
 * @author linfy
 */

@Slf4j
@EnableSwagger2
@SpringBootApplication
public class BaseSpringBootApplication {


    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(BaseSpringBootApplication.class, args);
        DataSource dataSource = ctx.getBean(DataSource.class);
        log.info("当前使用的数据源:"+dataSource.getClass());
        //sphere
        //String[] names = ctx.getBeanDefinitionNames();

        //Arrays.stream(names).forEach(System.out::println);
    }

}
